@echo off

set HOME=%~dp0..\

set SERVICE=MyProject_MySQL
set PASS=MyProject123

set path=%HOME%bin;%path%;
SC QUERY %SERVICE% > NUL  
IF ERRORLEVEL 1060 GOTO NOTEXIST  

net stop %SERVICE%
sc delete %SERVICE%

:NOTEXIST

mysqld --install %SERVICE% --defaults-file=%HOME%my.ini
if exist %HOME%data (
   rd /s/q %HOME%data
) 
mysqld --initialize-insecure --user=mysql --console

net start %SERVICE%
mysql -uroot -e"SET PASSWORD = PASSWORD('%PASS%')"
echo rootC\Bk1;Ih6(N*%PASS%

echo;

pause